package com.graduationdesign.zengyan.graduationdesignapp.ui.activities;

import com.graduationdesign.zengyan.graduationdesignapp.dataLayer.DataInjection;
import com.graduationdesign.zengyan.graduationdesignapp.ui.base.errorhandle.BaseErrorView;
import com.graduationdesign.zengyan.graduationdesignapp.ui.contact.LoginContact;
import com.graduationdesign.zengyan.graduationdesignapp.ui.contact.OrgContact;
import com.graduationdesign.zengyan.graduationdesignapp.ui.contact.ProfileContact;
import com.graduationdesign.zengyan.graduationdesignapp.ui.presenter.LoginPresenter;
import com.graduationdesign.zengyan.graduationdesignapp.ui.presenter.OrgsPresenter;
import com.graduationdesign.zengyan.graduationdesignapp.ui.presenter.ProfilePresenter;

/**
 * Created by ZengYan on 2018/4/20.
 *
 * @desc :
 */
public class PresenterInjection {

    public static LoginContact.Presenter provideLoginPresenter(LoginContact.View view, BaseErrorView errorView) {
        return new LoginPresenter(view, errorView, DataInjection.provideProfileRepository());
    }

    public static OrgContact.Presenter provideOrgPresenter(OrgsPresenter.Builder builder) {
        return builder
                .setMMainService(DataInjection.provideProfileRepository())
                .build();
    }

    public static ProfileContact.Presenter provideProfilePresenter(ProfilePresenter.Builder builder) {
        return builder
                .setMainService(DataInjection.provideProfileRepository())
                .build();
    }




}
